<?php
$this->load->view('admin/user/link_bar');
$user = $this->session->userdata('user');
?>
<form method="post" action="<?php echo base_url(); ?>admin/user/delete" class="form">

    <div class="box_function">
        <table width="747" border="0" cellpadding="0" cellspacing="0" class="listproduct" id="listproduct">
            <tr>
                <td class="tilte_list_pro">
                    <input name="checkme" class="noborder" onclick="checkDelBoxes(this.form, 'categoryBox[]', this.checked)" type="checkbox">
                </td>
                <td class="tilte_list_pro">
						ID<br>
                    <a href=""><img src="<?php echo base_url(); ?>images/admin/down.gif" border="0"></a>
                    <a href=""><img src="<?php echo base_url(); ?>images/admin/up.gif" border="0"></a>
                </td>
                <td class="tilte_list_pro">
						Last Name<br>
                    <a href=""><img src="<?php echo base_url(); ?>images/admin/down.gif" border="0"></a>
                    <a href=""><img src="<?php echo base_url(); ?>images/admin/up_d.gif" border="0"></a>
                </td>
                <td class="tilte_list_pro">
						First Name<br>
                    <a href=""><img src="<?php echo base_url(); ?>images/admin/down.gif" border="0"></a>
                    <a href=""><img src="<?php echo base_url(); ?>images/admin/up_d.gif" border="0"></a>
                </td>
                <td class="tilte_list_pro">
						Email<br>
                    <a href=""><img src="<?php echo base_url(); ?>images/admin/down.gif" border="0"></a>
                    <a href=""><img src="<?php echo base_url(); ?>images/admin/up_d.gif" border="0"></a>
                </td>
                <td class="tilte_list_pro">
						Profile<br>
                    <a href=""><img src="<?php echo base_url(); ?>images/admin/down.gif" border="0"></a>
                    <a href=""><img src="<?php echo base_url(); ?>images/admin/up_d.gif" border="0"></a>
                </td>
                <td class="tilte_list_pro" align="center">
						Active<br>
                    <a href=""><img src="<?php echo base_url(); ?>images/admin/down.gif" border="0"></a>
                    <a href=""><img src="<?php echo base_url(); ?>images/admin/up_d.gif" border="0"></a>
                </td>
                <td class="tilte_list_pro" style="width: 52px;">
						Actions
                </td>
            </tr>

            <?php
            for ($i = 0; $i < count($rows); $i++) {
                $id = $rows[$i]->id_user;
                $lastname = $rows[$i]->lastname;
                $firstname = $rows[$i]->firstname;
                $email = $rows[$i]->email;
                $profile = $rows[$i]->profile_name;
                $active = $rows[$i]->active == 1 ? 'checked.jpg' : 'nocheck.jpg';
                $active = '<img src=' . base_url() . 'images/' . $active . '>';

                if ($i % 2 == 0)
                    $css_class = 'row1';
                else
                    $css_class = 'row2';

                if ($user->id_user != $id AND $id == 1)
                    continue;
            ?>
                <tr onMouseOver="" class="<?php echo $css_class ?>">
                    <td class="product center">
                    <?php
                    if ($id != 1 AND $id != 2) {
                    ?>
                        <input name="categoryBox[]" value="<?php echo $id ?>" class="noborder" type="checkbox">
                    <?php
                    } else {
                        echo '<img align="left" src="' . base_url() . 'images/nocheck.jpg">';
                    }
                    ?>
                </td>

                <td class="product center" onclick="document.location = '#'">
                    <?php echo $id; ?>
                </td>

                <td class="product" onclick="document.location = '#'">
                    <?php echo $lastname; ?>
                </td>
                <td class="product" onclick="document.location = '#'">
                    <?php echo $firstname; ?>
                </td>
                <td class="product" onclick="document.location = '#'">
                    <?php echo $email; ?>
                </td>
                <td class="product" onclick="document.location = '#'">
                    <?php echo $profile; ?>
                </td>
                <td align="center" class="product" onclick="document.location = '#'">
                    <?php echo $active; ?>
                </td>
                <td class="center">
                    <a href="<?php echo base_url(); ?>admin/user/edit/<?php echo $id; ?>">
                        <img src="<?php echo base_url(); ?>images/admin/edit.gif" alt="Edit" title="Edit" border="0">
                    </a>
                    <?php if ($id != 1 AND $id != 2) {
 ?>
                        <a href="<?php echo base_url(); ?>admin/user/delete/<?php echo $id; ?>" onclick="return confirm('Delete item #{$id}?');">
                            <img src="<?php echo base_url(); ?>images/admin/delete.gif" alt="Delete" title="Delete" border="0">
                        </a>
<?php } ?>
                </td>
            </tr>
            <?php
                }
            ?>

                <tr>
                    <td colspan="6">
                        <p>
                            <input class="button" name="submitDelcategory" value="Delete selection" onclick="return confirm('Delete selected items?');" type="submit">
                        </p>
                        <p align="center">
<?php echo $this->pagination->create_links(); ?>
                    </p>
                </td>
            </tr>
        </table>
    </div>
</form>